package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_order_onedollar", schema = "", catalog = "onedollar")
public class TOrderOnedollarEntity {
    private int id;
    private Integer onedollarId;
    private Integer userId;
    private Timestamp createtime;
    private Integer payStatus;
    private Integer payType;
    private Integer orderId;
    private Integer ticketCode;
    private Integer ticketCodeEnd;
    private Integer randomCode;

    @Id
    @GeneratedValue
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "onedollar_id", nullable = true, insertable = true, updatable = true)
    public Integer getOnedollarId() {
        return onedollarId;
    }

    public void setOnedollarId(Integer onedollarId) {
        this.onedollarId = onedollarId;
    }

    @Basic
    @Column(name = "user_id", nullable = true, insertable = true, updatable = true)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "createtime", nullable = true, insertable = true, updatable = true)
    public Timestamp getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
    }

    @Basic
    @Column(name = "pay_status", nullable = true, insertable = true, updatable = true)
    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    @Basic
    @Column(name = "pay_type", nullable = true, insertable = true, updatable = true)
    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    @Basic
    @Column(name = "order_id", nullable = true, insertable = true, updatable = true)
    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    @Basic
    @Column(name = "ticket_code", nullable = true, insertable = true, updatable = true)
    public Integer getTicketCode() {
        return ticketCode;
    }

    public void setTicketCode(Integer ticketCode) {
        this.ticketCode = ticketCode;
    }

    @Basic
    @Column(name = "ticket_code_end", nullable = true, insertable = true, updatable = true)
    public Integer getTicketCodeEnd() {
        return ticketCodeEnd;
    }

    public void setTicketCodeEnd(Integer ticketCodeEnd) {
        this.ticketCodeEnd = ticketCodeEnd;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TOrderOnedollarEntity that = (TOrderOnedollarEntity) o;

        if (id != that.id) return false;
        if (onedollarId != null ? !onedollarId.equals(that.onedollarId) : that.onedollarId != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (createtime != null ? !createtime.equals(that.createtime) : that.createtime != null) return false;
        if (payStatus != null ? !payStatus.equals(that.payStatus) : that.payStatus != null) return false;
        if (orderId != null ? !orderId.equals(that.orderId) : that.orderId != null) return false;
        if (ticketCode != null ? !ticketCode.equals(that.ticketCode) : that.ticketCode != null) return false;
        if (ticketCodeEnd != null ? !ticketCodeEnd.equals(that.ticketCodeEnd) : that.ticketCodeEnd != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (onedollarId != null ? onedollarId.hashCode() : 0);
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (createtime != null ? createtime.hashCode() : 0);
        result = 31 * result + (payStatus != null ? payStatus.hashCode() : 0);
        result = 31 * result + (orderId != null ? orderId.hashCode() : 0);
        result = 31 * result + (ticketCode != null ? ticketCode.hashCode() : 0);
        result = 31 * result + (ticketCodeEnd != null ? ticketCodeEnd.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "random_code", nullable = true, insertable = true, updatable = true)
    public Integer getRandomCode() {
        return randomCode;
    }

    public void setRandomCode(Integer randomCode) {
        this.randomCode = randomCode;
    }
}
